package com.yykj.common.util;

import com.yykj.common.constant.CommonConstant;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

public class LocalRequestUtil {

	public static String getHeader(String header) {
		ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
				.getRequestAttributes();
		HttpServletRequest request = attributes.getRequest();
		return request.getHeader(header);
	}

	public static String getToken(){
		return getHeader(CommonConstant.TOKEN);
	}

}
